home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC_Samples / collect / collect.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  3.1 KB  |  129 lines

  1. // collect.cpp : Defines the class behaviors for the application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1999 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "collect.h"
  15.  
  16. #include "mainfrm.h"                        
  17. #include "colledoc.h"                              
  18. #include "strlstvw.h"                    
  19.  
  20. #ifdef _DEBUG
  21. #undef THIS_FILE
  22. static char BASED_CODE THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCollectApp
  27.  
  28. BEGIN_MESSAGE_MAP(CCollectApp, CWinApp)
  29.     //{{AFX_MSG_MAP(CCollectApp)
  30.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  31.     //}}AFX_MSG_MAP
  32.     // Standard file based document commands
  33.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  34.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  35. END_MESSAGE_MAP()
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // The one and only CCollectApp object
  39.  
  40. CCollectApp theApp;
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CCollectApp initialization
  44.  
  45. BOOL CCollectApp::InitInstance()
  46. {
  47.     LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  48.  
  49.     // Register document templates
  50.  
  51.     CSingleDocTemplate* pDocTemplate;
  52.     pDocTemplate = new CSingleDocTemplate(
  53.         IDR_MAINFRAME,
  54.         RUNTIME_CLASS(CCollectDoc),
  55.         RUNTIME_CLASS(CMainFrame),       // main SDI frame window
  56.         RUNTIME_CLASS(CStringListView));
  57.     AddDocTemplate(pDocTemplate);
  58.  
  59.     // create a new (empty) document
  60.     OnFileNew();
  61.  
  62.     if (m_lpCmdLine[0] != '\0')
  63.     {
  64.     }
  65.  
  66.     return TRUE;
  67. }
  68.  
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CAboutDlg dialog used for App About
  71.  
  72. class CAboutDlg : public CDialog
  73. {
  74. public:
  75.     CAboutDlg();
  76.  
  77. // Dialog Data
  78.     //{{AFX_DATA(CAboutDlg)
  79.     enum { IDD = IDD_ABOUTBOX };
  80.     //}}AFX_DATA
  81.  
  82. // Implementation
  83. protected:
  84.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  85.     //{{AFX_MSG(CAboutDlg)
  86.     virtual BOOL OnInitDialog();
  87.     //}}AFX_MSG
  88.     DECLARE_MESSAGE_MAP()
  89. };
  90.  
  91. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  92. {
  93.     //{{AFX_DATA_INIT(CAboutDlg)
  94.     //}}AFX_DATA_INIT
  95. }
  96.  
  97. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  98. {
  99.     CDialog::DoDataExchange(pDX);
  100.     //{{AFX_DATA_MAP(CAboutDlg)
  101.     //}}AFX_DATA_MAP
  102. }
  103.  
  104. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  105.     //{{AFX_MSG_MAP(CAboutDlg)
  106.         // No message handlers
  107.     //}}AFX_MSG_MAP
  108. END_MESSAGE_MAP()
  109.  
  110. /////////////////////////////////////////////////////////////////////////////
  111. // CAboutDlg message handlers
  112.  
  113. BOOL CAboutDlg::OnInitDialog() 
  114. {
  115.     CDialog::OnInitDialog();
  116.     CenterWindow();    
  117.     return TRUE;  
  118. }
  119.  
  120. // App command to run the dialog
  121. void CCollectApp::OnAppAbout()
  122. {
  123.     CAboutDlg aboutDlg;
  124.     aboutDlg.DoModal();
  125. }
  126.  
  127. /////////////////////////////////////////////////////////////////////////////
  128. // CCollectApp commands
  129.